package lbim.client.ui;

import java.util.Hashtable;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;

import de.enough.polish.ui.Form;
import de.enough.polish.ui.Gauge;
import de.enough.polish.util.Locale;

/**
 *
 * @author tharindu
 */
public class ProgressScreen extends Form implements CommandListener {

    private MainUI ui_;
    private Hashtable commands_;

    //#style .busyIndicator
    final private Gauge indicator_ = new Gauge( null, false, Gauge.INDEFINITE, Gauge.CONTINUOUS_RUNNING );

    public ProgressScreen() {

        //#style progrescreen
        super(Locale.get("progress.title")); //[LOCALE]

        ui_ = MainUI.getInstance();
        commands_ = ui_.getCommands();

        try {
            setCommandListener(this);
        } catch (Exception e) {
            e.printStackTrace();
        }
        
        addCommand((Command) commands_.get(new Integer(MainUI.CMD_CANCEL)));

        this.append(indicator_);

    }

    public void commandAction(Command c, Displayable d) {
        MainUI.hsenidCommand(c, d);
    }
}
